package com.xyh;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableEurekaClient
@EnableZuulProxy
@RestController
public class AppServer {
    public static void main(String[] args){
      new SpringApplicationBuilder(AppServer.class).web(true).run(args);
    }
    @Autowired
    private Environment env;
    @RequestMapping("/home")
   public String home(){
       System.out.println("读取的值"+env.getProperty("test.user.name"));
        return env.getProperty("test.user.name");
   }
}
